package com.qingcheng.dao;

import com.qingcheng.pojo.order.Order;
import com.qingcheng.pojo.order.TradeStatistics;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.time.LocalDate;
import java.util.List;

public interface OrderMapper extends Mapper<Order> {




    @Select("SELECT  \n" +
            "\t*\n" +
            "\t\n" +
            "FROM\n" +
            "\ttb_order o\n" +
            "\t\n" +
            "WHERE \n" +
            "\tDATE_FORMAT(o.`create_time`,'%Y-%m-%d')='#{date}'\n" +
            "\t\n" +
            "GROUP BY o.`username`\n")

    public TradeStatistics findOrders(@Param("date") LocalDate date);

}
